package com.mt.api.modules.service.impl;

import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.mt.common.response.WebResponse;
import com.mt.common.response.WebResponseUtils;
import com.mt.api.modules.domain.AppOrderDetail;
import com.mt.api.modules.mapper.AppOrderDetailMapper;
import com.mt.api.modules.service.AppOrderDetailService;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import java.util.List;

/**
*
* @description 服务实现
* @author plover
* @date 2020-07-06
**/
@Service
@RequiredArgsConstructor
public class AppOrderDetailServiceImpl extends ServiceImpl<AppOrderDetailMapper, AppOrderDetail> implements AppOrderDetailService {


    @Override
    public WebResponse getOrderDetail(Integer orderId) {
        List<AppOrderDetail> orderDetails = baseMapper.selectList(Wrappers.<AppOrderDetail>lambdaQuery()
                .eq(AppOrderDetail::getOrderId, orderId)
        .orderByDesc(AppOrderDetail::getCargoNo, AppOrderDetail::getColor));
        return WebResponseUtils.success(orderDetails);
    }
}